package com.deep.spring.v31.front;


import com.deep.spring.v31.enums.ErrorCodeEnum;
import org.springframework.core.convert.converter.Converter;

/**
 * 表单form/data格式或get请求实现Convert
 * 将stringCode直接转成enum
 *
 * @author deeprado
 * @date 2022/1/2 12:57
 */
public class StringCodeToEnumConvert implements Converter<String, ErrorCodeEnum> {
    @Override
    public ErrorCodeEnum convert(String source) {
        return ErrorCodeEnum.MAPzh.get(source);
    }
}
